Categories of Functions in C

1. Standard Library Functions

These are predefined functions provided by C libraries. These functions are available for use without needing to define them yourself. They are part of the C Standard Library, which includes functions for performing input and output, mathematical operations, string manipulations, memory allocations, and more.

Some examples of standard library functions are:

2. User-Defined Functions

These are functions that the programmer defines based on the requirements of the program. These functions allow you to break down a large program into smaller, manageable pieces, and they are usually designed to perform specific tasks.

A user-defined function can have:

Example of a user-defined function:

#include < stdio.h>
// Function declaration
int add(int a, int b);

// Main function
int main() {
    int result = add(5, 3);
    printf("The sum is: %d\n", result);
    return 0;
}

// Function definition
int add(int a, int b) {
    return a + b;
}